﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="NewSubClass.aspx.cs" Inherits="Main_Tax_NewSubClass" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>New Sub Class</title>
    <link href="../../Styles/accounts.css" rel="stylesheet" type="text/css" />

    <script type="text/javascript">
        function isNumberKey(control_id, evt) {
            var charCode = (evt.which) ? evt.which : event.keyCode
            if (charCode > 31 && (charCode < 48 || charCode > 57) && (charCode < 45 || charCode > 47))
                return false;

            if (charCode == 46) {
                var dotcount = document.getElementById(control_id).value.split('.').length - 1;
                if (dotcount >= 1) {
                    return false;
                }
            }
            return true;
        }
        function ValidateInput() {
            var flag = true;
            if (document.getElementById("ddlTaxType").value == '0') {
                alert('Specify Tax Type');
                flag = false;
                document.getElementById("ddlTaxType").focus();

            }
            else if (document.getElementById("ddlMainClass").value == '0') {
                alert('Specify Tax Main Class');
                flag = false;
                document.getElementById("ddlMainClass").focus();

            }
            else if (document.getElementById("ddlSubClass").value == '0') {
                alert('Specify Tax Sub Class');
                flag = false;
                document.getElementById("ddlSubClass").focus();

            }
            else if (document.getElementById("txtTaxRate").value == '') {
                alert('Specify Tax Rate');
                flag = false;
                document.getElementById("txtTaxRate").focus();

            }
            else if (document.getElementById("txtFromDate").value == '') {
                alert('Specify Effective From Date');
                flag = false;
                document.getElementById("txtFromDate").focus();

            }
            return flag;
        }
        function CheckValidateAddTaxLedger() {
            var table = document.getElementById("grdAdditionalTax");
            var tableRow = table.getElementsByTagName("tr");
            for (var i = 0; i < tableRow.length; i++) {
                var chkBox;
                var textBox;
                var inputs = tableRow[i].getElementsByTagName("input")
                for (var j = 0; j < inputs.length; j++) {
                    if (inputs[j].type == "checkbox") {
                        chkBox = inputs[j];
                    }
                    if (inputs[j].type == "text") {
                        textBox = inputs[j];
                    }
                }
                if (chkBox.checked == true) {
                    if (textBox.value == '') {
                        alert("rate");
                    }
                }

            }

            return false;
        }
    </script>

</head>
<body>
    <form id="form1" runat="server">
    <div style="width:50%; margin-left: 25%; margin-right: 25%;">
        <table class="tablecontent" style="width: 100%;">
            <tr>
                <td class="headtd" colspan="4">
                    New Sub Tax Class
                </td>
            </tr>
            <tr>
                <td>
                    Tax Type <span style="color: Red;">*</span>
                </td>
                <td>
                    <asp:DropDownList ID="ddlTaxType" runat="server" AutoPostBack="true" CssClass="dropdown"
                        Width="160px" OnSelectedIndexChanged="ddlTaxType_SelectedIndexChanged">
                    </asp:DropDownList>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="ddlTaxType"
                        ErrorMessage="*" ValidationGroup="tax"></asp:RequiredFieldValidator>
                </td>
            </tr>
            <tr>
                <td>
                    Main Class <span style="color: Red;">*</span>
                </td>
                <td>
                    <asp:DropDownList runat="server" ID="ddlMainClass" Enabled="false" Width="160px"
                        CssClass="dropdown" AutoPostBack="True" OnSelectedIndexChanged="ddlMainClass_SelectedIndexChanged">
                    </asp:DropDownList>
                </td>
            </tr>
            <tr>
                <td>
                    Sub Class <span style="color: Red;">*</span>
                </td>
                <td>
                    <asp:TextBox ID="txtSubClass" runat="server" CssClass="input" Width="160px"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td>
                    Short Name <span style="color: Red;">*</span>
                </td>
                <td>
                    <asp:DropDownList runat="server" ID="ddlShortName" Enabled="false" CssClass="dropdown"
                        Width="160px" />
                </td>
            </tr>
            <tr>
                <td colspan="2" align="center">
                    <asp:Button ID="btnSave" runat="server" Text ="Save" CssClass="button" /> &nbsp;
                    <asp:Button ID="btnCancel" runat="server" Text="Cancel" CssClass="button" />
                </td>
            </tr>
        </table>
    </div>
    </form>
</body>
</html>
